# from selenium import webdriver
# from selenium.webdriver.chrome.service import Service
# from selenium.webdriver.support.ui import WebDriverWait
# from selenium.webdriver.common.by import By
# from selenium.webdriver.support import expected_conditions as EC
import time
import redis
import pymysql
# # from ip_proxy import checkout_time
# # service = Service(executable_path='../project/chromedriver.exe', port=9080)
# chrome_options = webdriver.ChromeOptions()
# # outputdir = '/usr/local/bin'
# # chrome_options.binary_location = '/opt/google/chrome/google-chrome'
# # service_log_path = "{}/chromedriver.log".format(outputdir)
# # service_args = ['--verbose']
#
# chrome_options.add_argument('--window-size=1366,768')
# # chrome_options.add_experimental_option('prefs', prefs) #禁止浏览器弹窗
# chrome_options.add_experimental_option('useAutomationExtension', False)
# chrome_options.add_experimental_option("excludeSwitches", ['enable-automation'])  # 去掉正在被自动化检测程序控制的提示
# # chrome_options.add_argument('user-agent={}'.format(UserAgent().random))
# # chrome_options.add_argument('--proxy-server=http://{}'.format(ip_port))
#
# # chrome_options.add_argument('--disable-gpu')
# # chrome_options.add_argument("--no-sandbox")  # 添加沙盒模式
# # # chrome_options.add_argument('--headless')
# # driver = webdriver.Remote(command_executor=service.service_url, options=chrome_options)
# # driver = webdriver.Chrome(executable_path='../project/chromedriver.exe',
# #                                chrome_options=chrome_options)  # service_args=service_args,service_log_path=service_log_path
# # driver.get("http://www.baidu.com")
# # time.sleep(2)
# # driver.find_element_by_xpath("//input[@id='kw']").send_keys('动情的句子')
# # time.sleep(3)
# # baidu = driver.find_element_by_xpath("//input[@id='su']")
# # baidu.click()
# # driver.implicitly_wait(2)
# # time.sleep(1)
# # text = driver.find_element_by_xpath('//*[@id="5"]/div[1]')
# # print(text.text.encode('utf-8').decode('utf-8'))
# # page = driver.find_element_by_xpath('//*[@id="page"]/div/a[10]')
# # # print(page.text)
# # time.sleep(10)
# # driver.quit()
# import json
# print(json.dumps('程子涵'))
mdb = redis.StrictRedis(host='61.160.221.101', port=6379, db=0, decode_responses=True, password='ma1114')  #
mdb.set('czh','i love you forever')
# a = b"5\xe2\x99\xa5\xe8\x8f\xa0\xe8\x90\x9d\xe7\x9a\x84\xe5\x8a\x9f\xe6\x95\x88\xe5\x92\x8c\xe9\xa3\x9f\xe7\x94\xa8\xe6\x96\xb9\xe6\xb3\x95\xe4\xb8\x8e\xe4\xbd\x9c\xe7\x94\xa8\xe3\x80\x81\xe7\xa6\x81\xe5\xbf\x8c\xe2\x99\xa5www.ys137.com\xe2\x99\xa51\xe2\x99\xa5\xe5\x85\xbb\xe7\x94\x9f\xe4\xb9\x8b\xe9\x81\x93\xe7\xbd\x91\xe2\x99\xa522\xe2\x99\xa5None\xe2\x99\xa5None\xe2\x99\xa513\xe2\x99\xa58\xe2\x99\xa51\xe2\x99\xa54\xe2\x99\xa51\xe2\x99\xa5jingguo1"
# print(a.decode())
# if 0.568<=1:
#     print(round(0.555,2))
# m_id = 5
# while True:
#     time.sleep(5)
#     val = mdb.hexists('repeat', m_id)
#     if not val:
#         mdb.hset('repeat',m_id,0)
#     else:
#         value_num= mdb.hget('repeat',m_id)
#         print(value_num)
#         if int(value_num) < 3:
#             mdb.hset('repeat', m_id, int(value_num)+1)
#             print('程子涵')
db_config = {
        'host':'103.85.85.247',
        'port':3306,
        'user': 'admin',
        'password': 'Root110qwe',
        'db': 'crm',
        'charset': 'utf8',
    }
conn = pymysql.connect(**db_config)
cur = conn.cursor()
# cur.execute('create tb_work ')
sql2 = 'select id,keyword,host_url,rank,current_rank,is_rank from tb_work where author_id=5'
cur.execute(sql2)
conn.commit()
cur.close()
conn.close()